package com.example.myproject.service;

import com.example.myproject.dto.*;
import com.example.myproject.dto.torrent.*;
import com.example.myproject.model.DownloadRecord;
import com.example.myproject.model.Tag;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import com.example.myproject.model.Tag;


public interface TorrentService {
    Long uploadFile(Long userId, String name, Long categoryId, String desc,
                MultipartFile file, List<Long>  tags,
                Double originPrice, Integer downloadLimit);
    Long uploadTorrent(Long userId, String name, Long categoryId, String desc,
                    MultipartFile file, List<Long>  tags,
                    Double originPrice, Integer downloadLimit);
    DownloadUrlDTO initiateDownload(Long torrentId, Long userId);
    void completeDownload(Long torrentId, DownloadNotifyDTO dto, Long userId);
    PagedResult<TorrentVO> search(SearchTorrentsDTO params);
    List<TorrentVO> byTag(String tagName);
    List<TorrentVO> byCategory(Integer categoryId);
    List<TorrentVO> sortByUploadTime(String order, Integer page, Integer size);
    List<TorrentVO> sortByDownloads(String order, Integer page, Integer size);
    TorrentDetailDTO getTorrentDetail(Long torrentId);
    List<Tag> getAllTags(); // 新增
    //List<DownloadRecord> getDownloadRecordsByUserId(Long userId);
    List<DownloadRecordDTO> getDownloadRecordsByUserId(Long userId);
    PagedResult<TorrentVO> filterByCategoryAndTags(FilterTorrentsDTO params);
}
